import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";

Vue.use(VueRouter);

const routes = [
    {
        path: "/",
        name: "home",
        component: HomeView,
        meta: {
            title: "首頁",
        },
    },
    {
        path: "/login",
        name: "login",
        component: () => import("../views/LogView.vue"),
        meta: {
            title: "在學",
        },
    },
    {
        path: "/messages",
        name: "messages",
        component: () => import("../views/MessagesView.vue"),
        meta: {
            title: "我的消息",
        },
    },
    {
        path: "/user",
        name: "user",
        component: () => import("../views/UserView.vue"),
        meta: {
            title: "我的",
        },
    },
    {
        path: "/user/setting",
        name: "setting",
        component: () => import("../views/SettingView.vue"),
        meta: {
            title: "设置",
        },
    },
    {
        path: "/user/profile",
        name: "profile",
        component: () => import("../views/ProfileView.vue"),
        meta: {
            title: "个人资料",
        },
    },
    {
        path: "/user/order",
        name: "order",
        component: () => import("../views/OrderView.vue"),
        meta: {
            title: "我的订单",
        },
    },
    {
        path: "/user/promocode",
        name: "promocode",
        component: () => import("../views/PromocodeView.vue"),
        meta: {
            title: "我的邀请码",
        },
    },
    {
        path: "/password",
        name: "password",
        component: () => import("../views/PasswordView.vue"),
        meta: {
            title: "密碼登錄",
        },
    },
    {
        path: "/vip",
        name: "vip",
        component: () => import("../views/VipView.vue"),
        meta: {
            title: "VIP会员",
        },
    },
    {
        path: "/buyvip",
        name: "buyvip",
        component: () => import("../views/BuyvipView.vue"),
        meta: {
            title: "收银台 ",
        },
    },
    {
        path: "/buyvip/pay",
        name: "pay",
        component: () => import("../views/PayView.vue"),
        meta: {
            title: "支付中",
        },
    },
    {
        path: "/vod/detail",
        name: "detail",
        component: () => import("../views/DetailView.vue"),
        meta: {
            title: "詳情",
        },
    },
    {
        path: "/vod/video",
        name: "video",
        component: () => import("../views/VideoView.vue"),
        meta: {
            title: "视频",
        },
    },
    {
        path: "/vod",
        name: "vod",
        component: () => import("../views/VodView.vue"),
        meta: {
            title: "全部課程",
        },
    },
];

const router = new VueRouter({
    mode: "hash", //嘻哈模式
    base: process.env.BASE_URL,
    routes,
});

export default router;
